package com.vcms.cms.entity;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * VoteTopic entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "vote_topic", catalog = "vcms_0.1")
public class VoteTopic implements java.io.Serializable {

	// Fields

	private Integer voteTopicId;
	private Site site;
	private String title;
	private String description;
	private Timestamp startTime;
	private Timestamp endTime;
	private Integer repeateHour;
	private Integer totalCount;
	private Integer multiSelect;
	private Boolean isRestrictMember;
	private Boolean isRestrictIp;
	private Boolean isRestrictCookie;
	private Boolean isDisabled;
	private Boolean isDef;
	private Set<VoteItem> voteItems = new HashSet<VoteItem>(0);

	// Constructors

	/** default constructor */
	public VoteTopic() {
	}

	/** full constructor */
	public VoteTopic(Site site, String title, String description,
			Timestamp startTime, Timestamp endTime, Integer repeateHour,
			Integer totalCount, Integer multiSelect, Boolean isRestrictMember,
			Boolean isRestrictIp, Boolean isRestrictCookie, Boolean isDisabled,
			Boolean isDef, Set<VoteItem> voteItems) {
		this.site = site;
		this.title = title;
		this.description = description;
		this.startTime = startTime;
		this.endTime = endTime;
		this.repeateHour = repeateHour;
		this.totalCount = totalCount;
		this.multiSelect = multiSelect;
		this.isRestrictMember = isRestrictMember;
		this.isRestrictIp = isRestrictIp;
		this.isRestrictCookie = isRestrictCookie;
		this.isDisabled = isDisabled;
		this.isDef = isDef;
		this.voteItems = voteItems;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "voteTopicId", unique = true, nullable = false)
	public Integer getVoteTopicId() {
		return this.voteTopicId;
	}

	public void setVoteTopicId(Integer voteTopicId) {
		this.voteTopicId = voteTopicId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "siteId")
	public Site getSite() {
		return this.site;
	}

	public void setSite(Site site) {
		this.site = site;
	}

	@Column(name = "title", length = 300)
	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	@Column(name = "description", length = 500)
	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	@Column(name = "startTime", length = 19)
	public Timestamp getStartTime() {
		return this.startTime;
	}

	public void setStartTime(Timestamp startTime) {
		this.startTime = startTime;
	}

	@Column(name = "endTime", length = 19)
	public Timestamp getEndTime() {
		return this.endTime;
	}

	public void setEndTime(Timestamp endTime) {
		this.endTime = endTime;
	}

	@Column(name = "repeateHour")
	public Integer getRepeateHour() {
		return this.repeateHour;
	}

	public void setRepeateHour(Integer repeateHour) {
		this.repeateHour = repeateHour;
	}

	@Column(name = "totalCount")
	public Integer getTotalCount() {
		return this.totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
	}

	@Column(name = "multiSelect")
	public Integer getMultiSelect() {
		return this.multiSelect;
	}

	public void setMultiSelect(Integer multiSelect) {
		this.multiSelect = multiSelect;
	}

	@Column(name = "isRestrictMember")
	public Boolean getIsRestrictMember() {
		return this.isRestrictMember;
	}

	public void setIsRestrictMember(Boolean isRestrictMember) {
		this.isRestrictMember = isRestrictMember;
	}

	@Column(name = "isRestrictIp")
	public Boolean getIsRestrictIp() {
		return this.isRestrictIp;
	}

	public void setIsRestrictIp(Boolean isRestrictIp) {
		this.isRestrictIp = isRestrictIp;
	}

	@Column(name = "isRestrictCookie")
	public Boolean getIsRestrictCookie() {
		return this.isRestrictCookie;
	}

	public void setIsRestrictCookie(Boolean isRestrictCookie) {
		this.isRestrictCookie = isRestrictCookie;
	}

	@Column(name = "isDisabled")
	public Boolean getIsDisabled() {
		return this.isDisabled;
	}

	public void setIsDisabled(Boolean isDisabled) {
		this.isDisabled = isDisabled;
	}

	@Column(name = "isDef")
	public Boolean getIsDef() {
		return this.isDef;
	}

	public void setIsDef(Boolean isDef) {
		this.isDef = isDef;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "voteTopic")
	public Set<VoteItem> getVoteItems() {
		return this.voteItems;
	}

	public void setVoteItems(Set<VoteItem> voteItems) {
		this.voteItems = voteItems;
	}

}